﻿namespace SanalMagaza.UI.Controllers
{
    using System;
    using System.Web.Mvc;
    using SanalMagaza.Model.ViewModel;

    public class ProductController : BaseController
    {
        [HttpGet]
        public ActionResult List(ProductFilter filter)
        {
            var list = Repository.GetAllProduct(filter);
            return View(list);
        }
        [HttpGet]
        public ActionResult Detail(string id)
        {
            var product = Repository.GetProduct(id);
            if (product == null)
                return RedirectToAction("List");
            ViewBag.ProductFeatures = product.ProductFeaturesRelations;
            return View(product);
        }

    }
}
